package com.soso.base.google.comm;

import java.util.List;

import javax.jdo.PersistenceManager;
import javax.jdo.PersistenceManagerFactory;

public interface BaseService {
	PersistenceManager getPm() ;
	PersistenceManagerFactory getPmFactory();
	void setPmFactory(PersistenceManagerFactory pmFactory);
	
	void create(Object obj);
	void createAll(List<?> list);
	void delete(Object obj);
	Object deleteByPK(Class<?> clazz,Object id);
	Long deleteAll(String GQL);
	Long deleteAll(String GQL,int startIndex,int endIndex);
	void deleteAll(List<?> list) ;
	Object update(Object obj);
	void updateAll(List<?> list);
	Object update(Class<?> clazz,Object id,Object pojo);
	int count(String GQL);
	int count(String GQL ,int startIndex,int endIndex);
	Object getByPK(Class<?> clazz,Object pk) ;
	
	List<?> query(String GQL);
	List<?> query(String GQL,int startIndex,int endIndex);
	List<?> query(String GQL,Object ...aobj);
	
	void create(PersistenceManager pm,Object obj);
	void createAll(PersistenceManager pm,List<?> list);
	void delete(PersistenceManager pm,Object obj);
	Object deleteByPK(PersistenceManager pm,Class<?> clazz,Object id);
	Long deleteAll(PersistenceManager pm,String GQL);
	Long deleteAll(PersistenceManager pm,String GQL,int startIndex,int endIndex);
	void deleteAll(PersistenceManager pm,List<?> list) ;
	Object update(PersistenceManager pm,Object obj);
	void updateAll(PersistenceManager pm,List<?> list);
	Object update(PersistenceManager pm,Class<?> clazz,Object id,Object pojo);
	int count(PersistenceManager pm,String GQL);
	int count(PersistenceManager pm,String GQL ,int startIndex,int endIndex);
	Object getByPK(PersistenceManager pm,Class<?> clazz,Object pk) ;
	
	List<?> query(PersistenceManager pm,String GQL);
	List<?> query(PersistenceManager pm,String GQL,int startIndex,int endIndex);
	List<?> query(PersistenceManager pm,String GQL,Object ...aobj);
}
